package com.collectplus.express.order;

import java.util.ArrayList;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.collectplus.express.R;
import com.collectplus.express.model.ReceiverBean;

import droid.frame.activity.base.BaseAdapterExt;

/**
 * 收银台 - 包裹等
 * 
 * @author coffee <br>
 *         2016-1-19下午3:22:25
 */
public class OrderPayAdapter extends BaseAdapterExt<ReceiverBean> {

	public OrderPayAdapter(ArrayList<ReceiverBean> items, Activity context) {
		super(items, context);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder viewHolder = null;
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(R.layout.item_pay_parcel, parent, false);
			viewHolder = new ViewHolder();
			viewHolder.name = (TextView) convertView.findViewById(R.id.item_pay_parcel_name);
			viewHolder.mobile = (TextView) convertView.findViewById(R.id.item_pay_parcel_mobile);
			viewHolder.money = (TextView) convertView.findViewById(R.id.item_pay_parcel_money);
			convertView.setTag(viewHolder);
		} else {
			viewHolder = (ViewHolder) convertView.getTag();
		}

		viewHolder.name.setText(getItem(position).getName());
		viewHolder.mobile.setText(getItem(position).getPhone());
		viewHolder.money.setText(getItem(position).getCost() + "元");
		return convertView;
	}

	private class ViewHolder {
		private TextView name;
		private TextView mobile;
		private TextView money;
	}

}
